﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Areas/AdminPanel/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<WebMVC.Areas.AdminPanel.Models.TaxiServiceListViewModel>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Taxi services
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Taxi service list</h2>

    <table style="width:100%">
        <tr>
            <th>
                Id
            </th>
            <th>
                Name
            </th>
            <th>
                Phone Number
            </th>
            <th>
                Price/KM
            </th>
            <th>
                Min Price
            </th>
            <th>
                Min Price KM
            </th>
            <th>
                Params
            </th>
            <th>
                Added On
            </th>
            <th>
                Status
            </th>
            <th>Actions</th>
        </tr>

    <% foreach (var item in Model) { %>
    
        <tr>
            
            <td>
                <%= Html.Encode(item.Id) %>
            </td>
            <td>
                <%= Html.Encode(item.NameEN) %>
            </td>
            <td>
                <%= Html.Encode(item.PrimaryPhoneNumber) %>
            </td>
            <td>
                <%= Html.Encode(item.PricePerKM) %>
            </td>
            <td>
                <%= Html.Encode(item.MinPrice) %>
            </td>
            <td>
                <%= Html.Encode(item.MinPriceKM) %>
            </td>
            <td>
                <%if (item.HasMeter)
                  {%>
                  <img src="/Content/icons/icon-meter.png" alt="Has meter" />
                <%} %>
                <%if (item.NoSmoking)
                  {%>
                  <img src="/Content/icons/nosmoking-icon.png" alt="No smoking cars" />
                <%} %>
                <%if (item.Conditioning)
                  {%>
                  <img src="/Content/icons/cold-icon.png" alt="Has conditioner" />
                <%} %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:g}", item.CreateDate)) %>
            </td>
            <td>
                <%= Html.Encode(item.Status) %>
            </td>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new { id = item.Id }, new {@class="icon-link edit-link" })%> |
                <%= Html.ActionLink("Details", "Details", new { id = item.Id }, new { @class = "icon-link details-link" })%> |
                <%= Html.ActionLink("Delete", "Delete", new { id = item.Id }, new { @class = "icon-link delete-link" })%>
                <%= Html.ActionLink("Activate", "Activate", new { id = item.Id }, new { @class = "icon-link approve-link" })%>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("Create New", "Create", null, new { @class = "icon-link create-link" })%>
    </p>

</asp:Content>

